跳到主要内容

createPortal

createPortal 允许你将 JSX 作为 children 渲染至 DOM 的不同部分。

createPortal(children, domNode, key?)

设计目的

  • 使用 portal 渲染模态对话框